﻿// ***********************************************************************
// Assembly         : STX.Admin
// Author           : seven.x
// Created          : 12-26-2013
//
// Last Modified By : seven.x
// Last Modified On : 12-26-2013
// ***********************************************************************
// <copyright file="HomeController.cs" company="驰创数码">
//     Copyright (c) 驰创数码. All rights reserved.
// </copyright>
// <summary></summary>
// ***********************************************************************
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using STX.Lib.Logging;
using STX.Lib.Utils;
using STX.Service;

namespace STX.Admin.Controllers
{
    /// <summary>
    /// Class HomeController.
    /// </summary>
    public class HomeController : AuthController
    {
        public BizNoticeService BizNoticeService { get; set; }
        public BizMessageService BizMessageService { get; set; }
        public BizDownloadService BizDownloadService { get; set; }

        /// <summary>
        /// Indexes this instance.
        /// </summary>
        /// <returns>ActionResult.</returns>
        public ActionResult Index()
        {
            ILogger log;

            ViewBag.title = STXConfig.GetValue("config/app/name");
            return View();
        }

        /// <summary>
        /// Welcomes this instance.
        /// </summary>
        /// <returns>ActionResult.</returns>
        public ActionResult Welcome()
        {
            var dto = new STX.Admin.Models.Home.WelcomeModel
            {
                Notices = BizNoticeService.FindAll().ToList(),
                Messages = BizMessageService.FindAll().ToList(),
                Downloads = BizDownloadService.FindAll().ToList()
            };
            return View(dto);
        }
        
    }
}
